package io.renren.modules.simida.service.impl;

import io.renren.common.utils.Constant;
import io.renren.datasource.annotation.DataSource;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.simida.dao.SuggestionDao;
import io.renren.modules.simida.entity.SuggestionEntity;
import io.renren.modules.simida.service.SuggestionService;


@Service("suggestionService")
public class SuggestionServiceImpl extends ServiceImpl<SuggestionDao, SuggestionEntity> implements SuggestionService {

    @Override
    @DataSource(Constant.DB_SLAVE_SIMIDA)
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SuggestionEntity> page = this.page(
                new Query<SuggestionEntity>().getPage(params),
                new QueryWrapper<>()
        );

        return new PageUtils(page);
    }

}